<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>自然资源添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加自然资源信息':action=='Modify'?'修改自然资源信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'natural_resources_management', 'form': 'dataForm' ,'primary_key':'Natural_Resource_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">自然资源信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">自然资源编号</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请输入自然资源编号', trigger: 'blur' }]"
                prop="Natural_Resource_SerialNumber">
                <el-input v-model="dataForm.Natural_Resource_SerialNumber" class="borderless-input"
                  placeholder="请输入自然资源编号" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">自然资源名称</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请输入自然资源名称', trigger: 'blur' }]"
                prop="Natural_Resource_Name">
                <el-input v-model="dataForm.Natural_Resource_Name" class="borderless-input" placeholder="请输入自然资源名称" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">自然资源归属权</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择自然资源归属权', trigger: 'change' }]"
                prop="Natural_Resource_Ownership_Rights">
                <el-select clearable v-model.trim="dataForm.Natural_Resource_Ownership_Rights" placeholder="请选择自然资源归属权"
                  filterable style="width: 100%">
                  <el-option v-for="(value,key) in Ownership_Rights" :key="key" :label="value" :value="key"></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">自然资源类型</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择自然资源类型', trigger: 'change' }]"
                prop="Natural_Resource_Type_SerialNumber">
                <el-select clearable v-model.trim="dataForm.Natural_Resource_Type_SerialNumber" placeholder="请选择自然资源类型"
                  filterable style="width: 100%">
                  <el-option v-for="(item,index) in Natural_Resource_Type" :key="index" :label="item.Natural_Resource_Type" :value="item.Natural_Resource_Type_SerialNumber"></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">自然资源用途</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择自然资源用途', trigger: 'change' }]"
                prop="Natural_Resource_Usage_SerialNumber">
                <el-cascader @change="changeCity" class="borderless-input" v-model="cityValue" filterable
                  :props="{value:'Natural_Resource_Usage_SerialNumber',label:'Natural_Resource_Usage_Name',children:'children'}"
                  placeholder="请选择自然资源用途" :options="Natural_Resource_Usage" style="width: 100%"></el-cascader>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">自然资源类别</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择自然资源类别', trigger: 'change' }]"
                prop="Resource_Category_SerialNumber">
                <el-select clearable v-model.trim="dataForm.Resource_Category_SerialNumber" placeholder="请选择自然资源类别"
                  filterable style="width: 100%">
                  <el-option v-for="(item,index) in category" :key="index" :label="item.Resource_Category" :value="item.Resource_Category_SerialNumber"></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">村行政区</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择村行政区', trigger: 'change' }]"
                prop="Village_SerialNumber">
                <!-- <el-select @change="changeVillage" clearable v-model.trim="dataForm.Village_SerialNumber"
                  placeholder="请选择村行政区" filterable style="width: 100%">
                  <el-option v-for="(item,index) in village" :key="index" :label="item.Village"
                    :value="item.VillageNumber"></el-option>
                </el-select> -->
                <yl-cascader @change="changeVillage" v-model="dataForm.Village_SerialNumber" filterable clearable
                :props="{value:'ProvinceNumber',label:'Province',children:'children'}" placeholder="请选择村行政区"
                :options="city" style="width: 100%"></yl-cascader>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">权属单位</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请选择权属单位', trigger: 'change' }]" prop="Government_Agencies_SerialNumber">
                <yl-cascader v-model="dataForm.Government_Agencies_SerialNumber"  placeholder="请选择所属组织" :options="organization" 
                  :props="{ value:'Government_Agencies_SerialNumber', label:'Agensies_Name' ,checkStrictly: true }"></yl-cascader>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">责任人</div>
              </template>
              <el-form-item prop="Captain_Number" :rules="[{ required: true, message: '请选择责任人', trigger: 'change' }]">
                <div style="display: flex; align-items: center;">
                  <yl-select  v-model="dataForm.Captain_Number" clearable filterable placeholder="请选择责任人" 
                    :options="personal_information" :props="{value:'ID_Card_Number',label:'Personal_Name'}">
                    <el-table-column prop="ID_Card_Number" width="180" show-overflow-tooltip label="身份证号"></el-table-column>
                    <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                    <el-table-column prop="Birthday" show-overflow-tooltip label="出生日期"></el-table-column>
                    <el-table-column prop="Gender" label="性别"></el-table-column>
                    <el-table-column prop="Nation" label="民族"></el-table-column>
                    <el-table-column prop="Registered_Residence" show-overflow-tooltip label="籍贯"></el-table-column>
                    <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
                  </yl-select>
                </div>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">面积（亩）</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请输入面积（亩）', trigger: 'change' }]" prop="Area">
                <el-input v-model="dataForm.Area" class="borderless-input" placeholder="请输入面积" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">坐标集</div>
              </template>
              <el-form-item  :rules="[{ required: true, validator:IS_Coords, trigger: 'blur' }]" prop="Coords">
                <el-input  type="textarea" :autosize="{ minRows: 2}" @input="InputCoords" v-model.trim="dataForm.Coords" class="borderless-input" placeholder="请输入坐标集" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">空间坐标</div>
              </template>
              <el-form-item  :rules="[{ required: true, validator:IS_Coords, trigger: 'blur' }]" prop="KJZB">
                <el-input  v-model="dataForm.KJZB" class="borderless-input" placeholder="请输入空间坐标" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">地块东至</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请输入地块东至', trigger: 'blur' }]" prop="DKDZ">
                <el-input v-model="dataForm.DKDZ" class="borderless-input" placeholder="请输入地块东至" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">地块西至</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请输入地块西至', trigger: 'blur' }]" prop="DKXZ">
                <el-input v-model="dataForm.DKXZ" class="borderless-input" placeholder="请输入地块西至" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">地块北至</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请输入地块北至', trigger: 'blur' }]" prop="DKNZ">
                <el-input v-model="dataForm.DKNZ" class="borderless-input" placeholder="请输入地块北至" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">地块南至</div>
              </template>
              <el-form-item :rules="[{ required: true, message: '请输入地块南至', trigger: 'blur' }]" prop="DKBZ">
                <el-input v-model="dataForm.DKBZ" class="borderless-input" placeholder="请输入地块南至" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">图斑细化名称</div>
              </template>
              <el-form-item prop="DKBZ">
                <el-input v-model="dataForm.TBXHMC" class="borderless-input" placeholder="请输入图斑细化名称" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">种植属性名称</div>
              </template>
              <el-form-item prop="DKBZ">
                <el-input v-model="dataForm.ZZSXMC" class="borderless-input" placeholder="请输入种植属性名称" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">图斑面积</div>
              </template>
              <el-form-item prop="DKBZ">
                <el-input v-model="dataForm.TBMJ" class="borderless-input" placeholder="请输入图斑面积" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">确权</div>
              </template>
              <el-form-item prop="Confirmation_Rights">
                <el-switch v-model="dataForm.Confirmation_Rights" active-text="是" inactive-text="否" active-value="1" inactive-value="0"></el-switch>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">是否基本农田</div>
              </template>
              <el-form-item prop="SFJBNT">
                <el-switch v-model="dataForm.SFJBNT" active-text="是" inactive-text="否" active-value="1" inactive-value="2"></el-switch>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">质量等级</div>
              </template>
              <el-form-item prop="Quality_Grade">
                <el-select clearable v-model.trim="dataForm.Quality_Grade" placeholder="请选择质量等级" filterable
                  style="width: 100%">
                  <el-option v-for="(item,index) in natural_resources_quality_grade" :key="index"
                    :label="item.Quality_Grade_Name" :value="item.Quality_Grade_SerialNumber"></el-option>
                </el-select>
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">自然资源对应类型标签</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm}" ref="form1" :inline-message="true" style="width: 100%">
            <el-descriptions
              :data-options="JSON.stringify({ 'TableName': 'natural_resources_mapping_tags', 'form': 'childDataForm', 'ParentTableName': 'natural_resources_management'})"
              :column="2" size="large" border
              v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')" :key="index">
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">资源类型</div>
                </template>
                <el-form-item :rules="[{ required: true, message: '请选择资源类型', trigger: 'change' }]"
                  :prop="'childDataForm.'+index+'.Natural_Resource_Tag_SerialNumber'">
                  <el-select clearable v-model.trim="item.Natural_Resource_Tag_SerialNumber" placeholder="请选择资源类型"
                    filterable style="width: 100%">
                    <el-option v-for="(item,index) in Natural_Resource_Tag" :key="index"
                      :label="item.Natural_Resource_Tag" :value="item.Natural_Resource_Tag_SerialNumber"></el-option>
                  </el-select>
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain :loading="loading" @click="handleSubmit">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>